"""
统一工具集
供所有智能体使用的工具接口
"""

from .encoding_fix import (
    fix_console_encoding,
    ensure_utf8_output,
    safe_print
)

from .rate_limiter import (
    RateLimiter,
    api_rate_limiter,
    rate_limited_call
)

from .retry_helper import (
    retry_on_error,
    safe_api_call
)

from .tushare_tool import (
    get_stock_price,
    get_stock_info,
    get_stock_history,
    POPULAR_STOCKS
)

from .tavily_tool import (
    search_stock_news,
    search_market_news,
    search_industry_news
)

from .crewai_tools import (
    get_stock_price_tool,
    get_stock_info_tool,
    get_stock_history_tool,
    search_stock_news_tool,
    search_market_news_tool,
    search_industry_news_tool,
    STOCK_DATA_TOOLS,
    NEWS_TOOLS,
    ALL_TOOLS
)

# 自动修复编码
ensure_utf8_output()

__all__ = [
    # 编码修复
    'fix_console_encoding',
    'ensure_utf8_output',
    'safe_print',
    
    # 速率限制
    'RateLimiter',
    'api_rate_limiter',
    'rate_limited_call',
    
    # 重试机制
    'retry_on_error',
    'safe_api_call',
    
    # 股票工具（原始函数）
    'get_stock_price',
    'get_stock_info',
    'get_stock_history',
    'POPULAR_STOCKS',
    
    # 新闻工具（原始函数）
    'search_stock_news',
    'search_market_news',
    'search_industry_news',
    
    # CrewAI 工具
    'get_stock_price_tool',
    'get_stock_info_tool',
    'get_stock_history_tool',
    'search_stock_news_tool',
    'search_market_news_tool',
    'search_industry_news_tool',
    'STOCK_DATA_TOOLS',
    'NEWS_TOOLS',
    'ALL_TOOLS',
]
